Hypertext Transfer Protocol Status Codes
Hypertext Transfer Protocol (HTTP) Status Code can be described as a standardised status codes issued by the server in response to a client’s request. Below is a list of commonly used HTTP status codes;
Status Code 1xx – Informational
-
101 - Switching Protocols - (e.g. moving the client from HTTP to another protocol)
-
102 - Processing - indicates that the server has received and is processing the client’s request, but no there is response available yet.
Status Code 2xx – Successful
-
200 - Ok – The request has completed successfully.
-
201 - Created – (e.g. a new resource).
-
202 - Accepted – indicates that request has been accepted, but the processing has not been completed.
-
204 - No Content – indicates that the request was successful, but there’s nothing being return to the response body.
Status Code 3xx – Redirection
-
301 - Resource moved permanently.
-
304 - Not Modified – indicates that nothing was changed by the HTTP request e.g. PUT/PATCH.
-
307 - Resource Moved Temporarily.
-
308 - Permanent Redirect – the requested resources have permanently moved.
Status Code 4xx – Client Errors
-
400 - Bad Request – the request could not be processed by the server due to client error (e.g. malformed request syntax).
-
401 - Unauthorised – indicates that authorisation credentials are required.
-
402 - Payment Required - reserved for future use in digital cash or micropayment scheme.
-
403 - Forbidden – the request is well understood by the server, but the server has chosen to refuse the action. E.g. permission is required to access a resource or when a user attempts a prohibited action.
-
404 - Not Found – resource URI is not recognised by the server.
-
405 - Method Not Allowed – used when the request method is not supported for a requested resource e.g. a GET request on a form that requires data to be presented via HTTP POST.
-
408 - Request Timeout - The client did not provide a request within the server’s allotted timeframe.
-
409 - Conflict - Unable to perform the action, usually on a PUT due to conflict in the current state of the resource. E.g. edit conflict between multiple simultaneous updates.
-
410 - Gone - A resource that has previously existed was permanently deleted and is no longer available for access.
-
413 - Payload Too Large – the client request is larger than what the server is willing or able to process.
-
414 - URI Too Long - The URI provided is too long and is not acceptable by the server.
-
415 - Unsupported Media Type - The requested media type (content-type) is not supported by the server. E.g. a client XML request to a server that only supports JSON.
-
429 - Too Many Requests – too many requests have been sent to the server in the given timeframe.
Status Code 5xx – Server Error
-
500 - Internal Server Error - generic error message to represent an unexpected server condition.
-
501 - Not Implemented – Used when the client sends a request that the server did not recognise or unable to fulfil.
-
503 - Service Unavailable – The server is temporarily unable to respond to the request (e.g. due to overload or down for maintenance).